package merchants;

import java.util.ArrayList;

public class Merchant {
    private ArrayList<Long> merchant = new ArrayList<Long>();
    private String userName;
    private String passWord;

    public Merchant( String userName, String passWord,String id) {
        String[] temp = id.split("、");
        for (String e:temp) {
            merchant.add(Long.valueOf(e));
        }
        this.userName = userName;
        this.passWord = passWord;
    }

    public ArrayList<Long> getMerchant() {
        return merchant;
    }

    public void setMerchant(ArrayList<Long> merchant) {
        this.merchant = merchant;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    @Override
    public String toString() {
        StringBuilder str = new StringBuilder();
        str.append(userName+" "+passWord+" ");
        for(int i = 0 ; i < merchant.size() ; i ++ ) {
            if( i == 0 ) {
                str.append(merchant.get(i));
            }else {
                str.append("、"+merchant.get(i));
            }
        }
        str.append("\n");
        String S = new String(str);
        return S;
    }
}
